package com.lgl.serializer;

import com.alibaba.fastjson.JSON;

/**
 * @Auther: Brook
 * @Date: 2020/10/18 16:42
 * @Description:
 */
public class JSONSerializerImpl implements ISerializer {

    public byte[] serialize(Object object) {
        return JSON.toJSONBytes(object);
    }

    public <T> T deserialize(Class<T> clazz, byte[] bytes) {
        return JSON.parseObject(bytes, clazz);
    }
}
